package com.young.web;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//注意，在用thymeleaf模板时，不要使用RestController
@Controller
public class HelloController {

    @RequestMapping("/")
    public String index(ModelMap map) {
        //ModelMap类实现了Map接口,用来给页面传递参数
        map.addAttribute("host","https://gitee.com/fysola");
        //对应模板的是src/main/resources/templates/index.html
        return "index";
    }

}